/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.model.dao.orm;

import java.util.List;

/**
 *
 * @author Rdelacruz
 * @param <C>
 */
public class AbstractSesionDao<C extends Key> {
    private final SesionImpl<C> sesion = new SesionImpl<C>();
    
    public List<C> findAll() {
        return sesion.findAll();
    } 
    
    public C findByKey(String key) {
        return sesion.findByKey(key);
    } 
    
    public C findByObjeto(Key objeto) {
        return sesion.findByObjeto(objeto);
    }
    
    public C save(C objeto) {
        //return sesion.save(objeto,true);
        return sesion.save(objeto);
    }
    
    //public C save(C objeto, boolean noReemplazarSiExiste) {
    //    return sesion.save(objeto,noReemplazarSiExiste);
    //}

    public void clear() {
        sesion.clear();
    }
}
